﻿using System.Collections;
using GameCreator.Core;
using Gp.Scripts.Core;
using UnityEngine;

namespace Gp.GCX
{
    [AddComponentMenu("")]
    public class OpenNpcInventoryAc : IAction {
        public string characterName;


        public override IEnumerator Execute(GameObject target, IAction[] actions, int index, params object[] parameters) {
            // 在下一帧执行，防止与其他的生成冲突
            yield return 0;
            
            
            // InventorySystem.Instance.OpenCharacterInventoryUI(characterName, characterName);
        }


#if UNITY_EDITOR
        public new static string NAME = "Gp/库存/打开npc背包";
        private const string NODE_TITLE = "打开 [{0}] 的背包";

        public override string GetNodeTitle() {
            string str = characterName==null ? "玩家" : characterName;
            return string.Format(NODE_TITLE, str);
        }

#endif
    }
}